model{
  for (i in 1:n) {
    for (j in 1:m) {
      y[i, j] ~ dnorm(mu[i, j], inv.phi[j])
      mu[i, j] <- beta[j] * x[i]
    }
  }
  for (i in 1:n) {
    x[i] ~ dnorm(0, 100)
  }
  for (j in 1:m) {
    beta[j] ~ dnorm(0, 0.01)
    inv.phi[j] ~ dgamma(0.01, 0.01)
    phi[j] <- 1 / sqrt(inv.phi[j])
  }
}